﻿

using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;
using static Modules.CheckIn.CheckInDetailConstants;
using static Modules.Person.PersonConstants;

namespace Modules.CheckIn.Entitys;

/// <summary>
/// 考勤明细表
///</summary>
[TableName("checkin_detail")]
[Description("考勤明细表")]
[PrimaryKey("id", AutoIncrement = false)]
[CacheSetting(true, Name = "CheckInDetail")]
[Serializable]
public class CheckInDetail : IEntity
{
    /// <summary>
    /// 主键
    ///</summary>
    [PetaPoco.Column("id")]
    public string Id { get; set; } = Guid.NewGuid().ToString().Replace("-", "");

    /// <summary>
    /// 项目Id
    ///</summary>
    [PetaPoco.Column("project_id")]
    public int ProjectId { get; set; }

    /// <summary>
    /// 考勤月份
    ///</summary>
    [PetaPoco.Column("month")]
    public int Month { get; set; }

    /// <summary>
    /// 组成员id
    ///</summary>
    [PetaPoco.Column("member_id")]
    public int MemberId { get; set; }

    /// <summary>
    /// 考勤状态
    ///</summary>
    [PetaPoco.Column("status")]
    public 考勤状态 Status { get; set; }

    /// <summary>
    /// 进出标识
    ///</summary>
    [PetaPoco.Column("entry_exit_mark")]
    public 进出标识 EntryExitMark { get; set; }

    /// <summary>
    /// 数据来源
    ///</summary>
    [PetaPoco.Column("data_sources")]
    public 数据来源 DataSources { get; set; }

    /// <summary>
    /// 考勤日期
    ///</summary>
    [PetaPoco.Column("checkin_date")]
    public DateTime CheckinDate { get; set; }
    /// <summary>
    /// 考勤时间
    ///</summary>
    [Column("checkin_time")]
    public DateTime CheckinTime { get; set; }
    /// <summary>
    /// 创建时间
    ///</summary>
    [PetaPoco.Column("create_time")]
    public DateTime CreateTime { get; set; }

    /// <summary>
    /// 人员id
    ///</summary>
    [PetaPoco.Column("person_id")]
    public int PersonId { get; set; }

    /// <summary>
    /// 班组id
    ///</summary>
    [PetaPoco.Column("group_id")]
    public int GroupId { get; set; }

    /// <summary>
    /// 设备编码
    ///</summary>
    [PetaPoco.Column("equipment_code")]
    public string? EquipmentCode { get; set; }

    /// <summary>
    /// 人脸图片路径
    ///</summary>
    [PetaPoco.Column("face_path")]
    public string FacePath { get; set; }

    /// <summary>
    /// 文件对象名称 (桶名称)
    ///</summary>
    [PetaPoco.Column("object_name")]
    public string ObjectName { get; set; }

    /// <summary>
    /// 行业分类
    /// </summary>
    [Column("industry_type")]
    public 行业主管部门 IndustryType { get; set; }

    /// <summary>
    /// 归属省代码
    ///</summary>
    [Column("province_code")]
    public int? ProvinceCode { get; set; }

    /// <summary>
    /// 归属地市代码
    ///</summary>
    [Column("city_code")]
    public int? CityCode { get; set; }

    /// <summary>
    /// 归属区县代码
    ///</summary>
    [Column("area_code")]
    public int? AreaCode { get; set; }

    /// <summary>
    /// 当前工种  参考工人工种字典表
    ///</summary>
    [Column("work_type")]
    public 工人工种? WorkType { get; set; }
    /// <summary>
    /// 岗位类型
    /// </summary>
    [Column("post_category")]
    public 管理岗位类型? PostCategory { get; set; }

    #region IEntity 成员

    [Ignore]
    object IEntity.EntityId { get { return Id; } }

    #endregion IEntity 成员
}